from dotenv import load_dotenv
load_dotenv()
import pytest,requests
from selenium import webdriver
# 登录
@pytest.fixture(scope='function')
def login():
    url = 'http://10.59.9.12:7001/api/public/login'
    data = {
  "username": "19064013675",
  "password": "123456"
}
    login = requests.post(url=url,json=data)
    token = login.json()['data']['token']
    print(login.json())
    yield token
    return token

@pytest.fixture(scope='function')
def driver():
    driver = webdriver.Edge()
    driver.maximize_window()
    driver.implicitly_wait(10)
    yield driver
    driver.close()
    driver.quit()